using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace UM_Model.Models.Mapping
{
    public class ConnectiveMap : EntityTypeConfiguration<Connective>
    {
        public ConnectiveMap()
        {
            // Primary Key
            this.HasKey(t => t.ConnectiveID);

            // Properties
            this.Property(t => t.Title)
                .HasMaxLength(100);

            this.Property(t => t.Link)
                .HasMaxLength(200);

            // Table & Column Mappings
            this.ToTable("Connective");
            this.Property(t => t.ConnectiveID).HasColumnName("ConnectiveID");
            this.Property(t => t.Title).HasColumnName("Title");
            this.Property(t => t.Link).HasColumnName("Link");
            this.Property(t => t.IsEnable).HasColumnName("IsEnable");
        }
    }
}
